package cn.sofwin.day0129.homework.age;

public class Age {
    private int age;

    public void setAge(int age) throws IllegalArgumentException{

        if(age >= 1 && age <= 100){
            this.age = age;
        }else{
            throw new IllegalArgumentException("年龄必须在1~100之间");

        }

    }
}
